
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 22652
 * Date: 2024-04-23
 * Time: 21:08
 */
public class writre_thing {
    public static void main(String[] args) throws IOException {
        try (InputStream inputStream = new FileInputStream("C:\\Users\\22652\\Desktop\\程序\\iron\\Java_4_23\\中文文档.txt")) {
            while (true) {
                byte[] buf = new byte[1024];
                int n = inputStream.read(buf);
                if (n == -1) {
                    break;
                }
                String s = new String(buf, 0, n, "utf8");
                System.out.println(s);
            }
        }
    }
}
